﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Code.Models
{
    /// <summary>
    /// 表示要使用的语言
    /// </summary>
    public enum Language
    {
        /// <summary>
        /// 英文
        /// </summary>
        En = 1,
        /// <summary>
        /// 中文
        /// </summary>
        Ch = 2,
    }


    public static class LanguageExtension
    {
        public static string Name(this Language language)
        {
            switch (language)
            {
                case Language.En:
                    return "English";
                case Language.Ch:
                    return "简体中文";
                default:
                    throw new ArgumentOutOfRangeException("language");
            }
        }

        public static string FullName(this Language language)
        {
            switch (language)
            {
                case Language.En:
                    return "English";
                case Language.Ch:
                    return "Chinese";
                default:
                    throw new ArgumentOutOfRangeException("language");
            }
        }

        public static string Lower(this Language language)
        {
            return language.ToString().ToLower();
        }
    }
}
